Vue.component('todo-main', {
  template: `
    <section class="main">
    <input
      id="toggle-all"
      class="toggle-all"
      type="checkbox"
      v-model="checkAll"
    />
    <label for="toggle-all">Mark all as complete</label>
    <ul class="todo-list">
      <li
        :class="{completed:item.done,editing:editId === item.id}"
        v-for="(item,index) in todoList"
        :key="item.id"
      >
        <div class="view">
          <input class="toggle" type="checkbox" v-model="item.done" />
          <label @dblclick="edit(item.id)">{{item.todoName}}</label>
          <button class="destroy" @click="del(item.id)"></button>
        </div>
        <input
          class="edit"
          v-model.lazy="item.todoName"
          @blur="update"
          @keyup.enter="update"
          @keyup.esc="update"
        />
      </li>
    </ul>
  </section>
      `,
})
